package com.zzl.boot.bigevent.service.impl;


import com.zzl.boot.bigevent.mapper.userMapper;
import com.zzl.boot.bigevent.pojo.user;
import com.zzl.boot.bigevent.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class implUserService implements userService {
    @Autowired
    private userMapper userMapper;
    @Override
    public user getByUser(String userName) {
        user user = userMapper.getByUser(userName);
        if (user != null)
            return user;
        else
            return null;
    }
    @Override
    public void regist(String username, String password) {
        String pic="https://bigevent-zzl.oss-cn-beijing.aliyuncs.com/94d1d44b-7a3c-4b4a-898d-8841c3bbd731.png?Expires=1747556378&OSSAccessKeyId=TMP.3KooUKipTL4dCwHmQY4nQGARJwpPx3551UGsP3BKuH8Ggdvgzc4LemjQSrnJEy6djfe8CY6UND3wstouS8Q1ipJZLjJPnC&Signature=LjTg2au8qsiKYIusINwOuRS2mmY%3D";
        userMapper.add(username,password,pic);
    }

    @Override
    public void updateUserInfo(user user) {
        //user.setUpdateTime(LocalDateTime.now());
        userMapper.updateUserInfo(user);
    }

    @Override
    public void updateVat(Integer id, String vatURl) {
        userMapper.updateVat(id,vatURl);
    }

    @Override
    public void updatePwd(Integer id, String newPassword) {
        userMapper.updatePwd(id,newPassword);
    }

    @Override
    public user getById(Integer id) {
        return userMapper.getById(id);
    }
}
